#ifdef _DEBUG
#pragma comment(lib, "../Debug/PowerLibraryEngine.lib")
#else
#pragma comment(lib, "../Release/PowerLibraryEngine.lib")
#endif

#include "../PowerLibraryEngine/include/PowerLibraryEngine.h"

I2DCameraSceneNode *Camera2D = NULL;

int main(int argc, char* argv[])
{
	u32 LastFPS=0;
	InitPLEVideo(vector2du32(800,600),false,true,false,false,DRV_USEDEFAULT,"",true,LOG_ALL);
	GetDevice()->SetCaption("PLETest");

	Camera2D = SceneManager->GetSceneGenerator()->GetNew2DCameraSceneNode();
	Camera2D->SetParent(SceneManager);

	SceneManager->GetSceneGenerator()->SetDefaultScene2DParent(Camera2D);
	SceneManager->SetActive2DCamera(Camera2D);
//	Camera2D->SetScale(2.0,2.0,2.0);

	FileSystem->ReadActualDirectory();

	IImage *ImgTmp = FileSystem->GetImage("prueba.gff");
	ITexture *TxtTmp = VideoDriver->CreateTextureFromImage(ImgTmp);
	I2DSpriteSceneNode *Temp = SceneManager->GetSceneGenerator()->GetNew2DSpriteSceneNode(TxtTmp);

	while (Device->Update())
	{
		u32 ActualFPS = VideoDriver->GetFPS();
		if (ActualFPS != LastFPS)
		{
			stringc caption = "PLETest FPS:";
			caption += Device->ConvertFromNumber(ActualFPS);
			Device->SetCaption(caption);
			LastFPS = ActualFPS;
		}

		VideoDriver->BeginRender();
		SceneManager->RenderAll(TimeManager->GetActualTime());
		VideoDriver->EndRender();
		TimeManager->UpdateFrameTime();
	}

	delete TxtTmp;
	delete ImgTmp;
	DestroyDevice();

	return 0;
}
